<template>
    <a-form :model="formState" :labelCol="{ span: 6 }" name="basic" autocomplete="off">
        <a-row>
            <a-form-item label="教学工作量要求" name="teachWorkload" style="width:500px"
                :rules="[{ required: true, message: '请输入教学工作量要求' }]">
                <a-input-number :min="0" :step="0.1" style="width:300px" v-model:value="formState.teachWorkload" />
            </a-form-item>
            <a-form-item label="科研工作量要求" name="researchWorkload" style="width:500px"
                :rules="[{ required: true, message: '请输入科研工作量要求' }]">
                <a-input-number :min="0" :step="0.1" style="width:300px" v-model:value="formState.researchWorkload" />
            </a-form-item></a-row>
        <a-row>
            <a-form-item label="管理工作量要求" name="manageWorkload" style="width:500px"
                :rules="[{ required: true, message: '请输入管理工作量要求' }]">
                <a-input-number :min="0" :step="0.1" style="width:300px" v-model:value="formState.manageWorkload" />
            </a-form-item>
            <a-form-item label="其他工作量要求" name="otherWorkload" style="width:500px"
                :rules="[{ required: true, message: '请输入其他工作量要求' }]">
                <a-input-number :min="0" :step="0.1" style="width:300px" v-model:value="formState.otherWorkload" />
            </a-form-item></a-row>
        <a-button key="submit" type="primary"  @click="submit">提交</a-button>
    </a-form>
</template>
<script setup>
import { updateExt } from "@/module/system/api/job.js"
const formState = ref({
    teachWorkload: 0,
    researchWorkload: 0,
    manageWorkload: 0,
    otherWorkload: 0
});
function submit() {
    let id = location.href.split('=')
    formState.value.id = id[1]
    updateExt(formState.value).then(res => {
        console.log(res)
    })
}
</script>